package com.cts.learninglibrary.controller;

import com.cts.learninglibrary.service.UserService;
import com.cts.learninglibrary.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author arctique
 * @date 2020/8/11 15:34
 */
@RestController
@RequestMapping
@CrossOrigin
public class HelloController {

    @Autowired
    private UserService userService;

    @GetMapping("/hello")
    public R sayHello() {
        return userService.findAll();
    }
}
